import React from 'react';
import {
  Route,
  // Redirect,
} from 'react-router-dom';
import Loadable from 'react-loadable';

const Index = Loadable({
  loader: () =>
    import ( /* webpackChunkName:'index' */ '../pages/index/index'),
  loading: () => <div className="loading-box">loading...</div>
})

const RankingList = Loadable({
  loader: () =>
    import ( /* webpackChunkName:'rankingList' */ '../pages/rankingList/rankingList'),
  loading: () => <div className="loading-box">loading...</div>
})

const Poster = Loadable({
  loader: () =>
    import ( /* webpackChunkName:'poster' */ '../pages/poster/poster'),
  loading: () => <div className="loading-box">loading...</div>
})

// import Index from '../pages/index/index';

export default () => [
  <Route path="/" component={Index} exact key="index" />,
  <Route path="/rankingList" component={RankingList} exact key="rankingList" />,
  <Route path="/poster" component={Poster} exact key="poster" />,
]
// <Route path="/" render={() => <Redirect to="/list" />} exact key="first" />,